<!--
 * @Descripttion: 开关
 * @version: 0.0.1
 * @Author: zhangmeng
 * @Date: 2022-02-22 13:50:38
 * @LastEditors: zhangmeng
 * @LastEditTime: 2022-02-22 15:18:58
-->
<template>
  <div class="change-switch">
    <el-switch
      v-model="val"
      active-color="#409eff"
      inactive-color="#010101"
      @change="change"
    >
    </el-switch>
  </div>
</template>
<script>
export default {
  props: ["value","type"],
  data() {
    return {
      val: this.value,
    };
  },
  methods: {
    change(data) {
      console.log(data,'data');
      this.$emit("change", {
        key:this.type,
        value:data
      });
    },
  },
};
</script>

<style scoped="scoped">
.change-switch {
  height: 40px;
  line-height: 40px;
}
</style>